package com.gourd.common.data;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.Version;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @author gourd
 */
@Data
public class BaseEntity implements Serializable {

    /**
     * 主键id
     */
    @TableId(type= IdType.INPUT)
    private Long id;

    /**
     * 创建人
     */
    @TableField(value = "created_by",fill = FieldFill.INSERT)
    private Long createdBy;

    /**
     * 创建时间
     */
    @TableField(value = "created_time",fill = FieldFill.INSERT)
    private Date createdTime;

    /**
     * 更新人
     */
    @TableField(value = "updated_by",fill = FieldFill.UPDATE)
    private Long updatedBy;

    /**
     * 更新时间
     */
    @TableField(value = "updated_time",fill = FieldFill.UPDATE)
    private Date updatedTime;

    /**
     * 版本号
     */
    @Version
    @TableField(value = "version")
    private Long version;

    /**
     * 逻辑删除状态
     */
    @TableLogic
    @TableField(value = "is_deleted")
    private Boolean deleted;


}
